package com.tpc.control.jpa;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * Interface for CommonDataDAO.
 * 
 * @author MyEclipse Persistence Tools
 */

public interface ICommonDataDAO {
	/**
	 * Perform an initial save of a previously unsaved CommonData entity. All
	 * subsequent persist actions of this entity should use the #update()
	 * method. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#persist(Object)
	 * EntityManager#persist} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ICommonDataDAO.save(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            CommonData entity to persist
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void save(CommonData entity);

	/**
	 * Delete a persistent CommonData entity. This operation must be performed
	 * within the a database transaction context for the entity's data to be
	 * permanently deleted from the persistence store, i.e., database. This
	 * method uses the {@link javax.persistence.EntityManager#remove(Object)
	 * EntityManager#delete} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ICommonDataDAO.delete(entity);
	 * EntityManagerHelper.commit();
	 * entity = null;
	 * </pre>
	 * 
	 * @param entity
	 *            CommonData entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void delete(CommonData entity);

	/**
	 * Persist a previously saved CommonData entity and return it or a copy of
	 * it to the sender. A copy of the CommonData entity parameter is returned
	 * when the JPA persistence mechanism has not previously been tracking the
	 * updated entity. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#merge(Object) EntityManager#merge}
	 * operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * entity = ICommonDataDAO.update(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            CommonData entity to update
	 * @return CommonData the persisted CommonData entity instance, may not be
	 *         the same
	 * @throws RuntimeException
	 *             if the operation fails
	 */
	public CommonData update(CommonData entity);

	public CommonData findById(CommonDataId id);

	/**
	 * Find all CommonData entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the CommonData property to query
	 * @param value
	 *            the property value to match
	 * @return List<CommonData> found by query
	 */
	public List<CommonData> findByProperty(String propertyName, Object value);

	public List<CommonData> findByCustomer(Object customer);

	public List<CommonData> findByCustomerName(Object customerName);

	public List<CommonData> findByCustomerPoNo(Object customerPoNo);

	public List<CommonData> findByDistrChannel(Object distrChannel);

	public List<CommonData> findByPirNo(Object pirNo);

	public List<CommonData> findByDivision(Object division);

	public List<CommonData> findByMaterial(Object material);

	public List<CommonData> findByDesignNoFg(Object designNoFg);

	public List<CommonData> findByDyelotLab(Object dyelotLab);

	public List<CommonData> findByQuantity(Object quantity);

	public List<CommonData> findByUom(Object uom);

	public List<CommonData> findByFinishGoods(Object finishGoods);

	public List<CommonData> findByPoNo(Object poNo);

	public List<CommonData> findByDesignNoGreige(Object designNoGreige);

	public List<CommonData> findByPlanGreige(Object planGreige);

	public List<CommonData> findByGreigeRemark(Object greigeRemark);

	public List<CommonData> findByDyeRemark(Object dyeRemark);

	public List<CommonData> findByDueSubmitDate(Object dueSubmitDate);

	public List<CommonData> findByStatus(Object status);

	public List<CommonData> findByCurrentOperation(Object currentOperation);

	public List<CommonData> findByUserStatus(Object userStatus);

	public List<CommonData> findByTotProduceQty(Object totProduceQty);

	public List<CommonData> findByColorStatus(Object colorStatus);

	public List<CommonData> findByConfirmType(Object confirmType);

	public List<CommonData> findByUserStatusCode(Object userStatusCode);

	public List<CommonData> findByOverdueStatus(Object overdueStatus);

	public List<CommonData> findByReserveDyeRemark(Object reserveDyeRemark);

	/**
	 * Find all CommonData entities.
	 * 
	 * @return List<CommonData> all CommonData entities
	 */
	public List<CommonData> findAll();
}